export function dateFormat(val:any){
  const date: Date = new Date(val);
  const formattedDate: string = date.toLocaleDateString('zh-CN', {year: 'numeric', month: 'long', day: 'numeric'});
  return formattedDate;
}

export function formatTsDate(inputDate: string): string {
  const monthsMap: { [key: string]: string } = {
    Jan: '01',
    Feb: '02',
    Mar: '03',
    Apr: '04',
    May: '05',
    Jun: '06',
    Jul: '07',
    Aug: '08',
    Sep: '09',
    Oct: '10',
    Nov: '11',
    Dec: '12',
  };

  const dateObj = new Date(inputDate);
  const year = dateObj.getFullYear();
  const month = monthsMap[dateObj.toDateString().split(' ')[1]];
  const day = dateObj.getDate();

  // 使用 padStart 函数确保月份和日期是两位数
  const formattedMonth = month.padStart(2, '0');
  const formattedDay = day.toString().padStart(2, '0');

  return `${year}年${formattedMonth}月${formattedDay}日`;
}